package entity

import (
	"gorm.io/gorm"
	"time"
)

type SysPermission struct {
	PermId        uint32 `gorm:"perm_id,primaryKey" json:"perm_id"`                      //
	ParentId      uint32 `gorm:"parent_id"       json:"parent_id"`                       // 父级角色ID
	Name          string `gorm:"name"            json:"name" binding:"required"`         // 权限定义名
	DisplayName   string `gorm:"display_name"    json:"display_name" binding:"required"` // 权限显示名
	Description   string `gorm:"description"     json:"description"`                     // 权限描述
	OrderNum      uint32 `gorm:"order_num"       json:"order_num" binding:"min=0"`       // 排序数字，值越小越靠前
	IsPublic      bool   `gorm:"is_public"       json:"is_public"`                       // 是否为公共权限,1:公共权限,0:授权权限
	IsOpertionLog bool   `gorm:"is_opertion_log" json:"is_opertion_log"`                 // 是否记录操作日志
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     gorm.DeletedAt `gorm:"index"`
}

//设置表名
func (e *SysPermission) TableName() string {
	return "sys_permissions"
}
